package org.myspringframework.bean3;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class Product {
    private String name;

    public Product(@Value("葡萄") String name) {
        this.name = name;
    }

//    @Value("葡萄")
//    public void setName(String name) {
//        this.name = name;
//    }

    @Override
    public String toString() {
        return "Product{" +
                "name='" + name + '\'' +
                '}';
    }
}
